package com.example;

import java.io.IOException;
import java.io.OutputStream;

public class MyResponse {
    private OutputStream outputstream;

    public MyResponse(OutputStream outputstream) {
        this.outputstream = outputstream;
    }
    public void write(String content) throws IOException {
        StringBuffer httpResponse = new StringBuffer();
        httpResponse.append("HTTP/1.1 299 OKn")
                .append("Content-Type: text/html\n")
                .append("\r\n")
                .append("<html><body>")
                .append(content)
                .append("</body></html>");
        outputstream.write(httpResponse.toString().getBytes());
        outputstream.close();
    }

}